<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../common.inc" %>    
<%java.util.Random r=new java.util.Random();  %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link href="./css/style1.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="./js/form.js"></script>
<script type="text/javascript" language="javascript">
<!--
function costDetail()
{
	var costAry = document.getElementsByName("costChecked");
	var checkNum = 0;
	var checkId;
	for(var i=0; i<costAry.length; i++)
	{
		if(costAry[i].checked)
		{
			checkNum++;
			checkId = costAry[i].value;
		}
		if(chechNum > 1)
		{
			alert("每次只能核销一个费用");
			return false;
		}
		
	}
	
	window.location.href = "./contract.do?action=costDetail&costId="+checkId;
	window.location.target = "main";
	
}
	
-->
</script>
</head>
<body>
<form name="deptContractForm" action="" method="post">
	<table class="table_frame">
		<tr>
			<td>
				<table class="table_title1">
					<tr>
						<td class="title_lab">
							<c:if test="${costType == 'officialCost' }">官费管理</c:if>
							<c:if test="${costType == 'operationCost' }">业务费管理</c:if>
						</td>
					</tr>
					<tr>
						<td valign="bottom" class="a_tools" style="padding-left: 3px;">案件编号：
							<input id="contractCaseCode" name="contractCaseCode" class="input_query" type="text" value="${contractCaseCode}"/>
							<input id="sFlag" name="sFlag" type="hidden" value="${sFlag}"/>
							<a class="search" href="javascript:searchContract();" title="" hidefocus="true">查询</a>
							|
							<a class="search" href="javascript:costDetail();" title="" hidefocus="true">核销</a>
						</td>
					</tr>
					<tr><td height="2"></td></tr>
				</table>
			</td>
		</tr>
		<tr>
			<td>
				<table class="table_title2">
					<tr>
						<td class="title_lab">							
							<c:if test="${costType == 'officialCost' }">官费管理</c:if>
							<c:if test="${costType == 'operationCost' }">业务费管理</c:if>
						</td>
						<td align="right" valign="">
							<!-- page -->
							<table class="table_page2">
								<tr>
									<td valign="bottom">
										<img src="./images/frist.bmp" onclick="pageContract(1)" alt="首页" style="vertical-align: middle;cursor: hand;">
										<img src="./images/last.bmp" onclick="pageContract(2)" alt="上一页" style="vertical-align: middle;cursor: hand;">&nbsp;
										<font color="red">${currentPage}</font>/${totalPages}&nbsp;<fmt:message key='common.page'/>&nbsp;
										<img src="./images/next.bmp" onclick="pageContract(3)" alt="下一页" style="vertical-align: middle;cursor: hand;">
										<img src="./images/end.bmp" onclick="pageContract(4)" alt="末页" style="vertical-align: middle;cursor: hand;">
										共&nbsp;&nbsp;${totalRows}&nbsp;<fmt:message key='common.page.totalRow'/>&nbsp;&nbsp;&nbsp;
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr><td colspan="3" height="2"></td></tr>
					<tr>
						<td valign="top" colspan="2">
							<table class="table">
								<tr>
									<td valign="top">
										<table class="table_style">
											<tr>
												<td class="title_top"></td>
												<td class="title_top">
													<c:if test="${costType == 'officialCost' }">官费管理</c:if>
													<c:if test="${costType == 'operationCost' }">业务费管理</c:if>
												</td>
												<td class="title_top">计划付款日期</td>
												<td class="title_top">付款账户信息</td>
												<td class="title_top">总金额</td>
												<td class="title_top">申请人</td>
											</tr>
											<c:forEach var="cost" items="${costList}">
											<tr onmouseover="onmousemoveChange(this,'img${cost.id}')" onmouseout="onmouseoutChange(this,'img${cost.id}')">
												<td height="16" width="8" align="right"><img id="img${cost.id}" src="./images/table_sign2.bmp"></td>
												<td>
													<input id="costChecked" name="costChecked" type="checkbox" value="${cost.costId}"/>
													<a href="./contract.do?action=costDetail&costId=${cost.costId}" target="main">${cost.costId}</a>
												</td>
												<td><fmt:formatDate value="${cost.paymentDate}" pattern="yyyy-MM-dd"/></td>
												<td>${cost.paymentAccount}</td>
												<td>${cost.costTotal}</td>
												<td>${cost.personName}</td>
											</tr>
											</c:forEach>
										</table>
									</td>
								</tr>
								<tr>
									<td align="left" valign="bottom">
										<!-- page -->
										<table id="tp" class="table_page">
											<tr>
												<td>&nbsp;&nbsp;
													<img src="./images/frist.bmp" onclick="pageContract(1)" alt="首页" style="vertical-align: middle;cursor: hand;">
													<img src="./images/last.bmp" onclick="pageContract(2)" alt="上一页" style="vertical-align: middle;cursor: hand;">&nbsp;
													<font color="red">${currentPage}</font>/${totalPages}&nbsp;<fmt:message key='common.page'/>&nbsp;
													<img src="./images/next.bmp" onclick="pageContract(3)" alt="下一页" style="vertical-align: middle;cursor: hand;">
													<img src="./images/end.bmp" onclick="pageContract(4)" alt="末页" style="vertical-align: middle;cursor: hand;">
													共&nbsp;&nbsp;${totalRows}&nbsp;<fmt:message key='common.page.totalRow'/>
												</td>
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
</form>
</body>
</html>